Fix crash when stack is messed up