This code was completely broken and corrupts the stack, replace it with something that is actually safe.