Fix some theoretical crashes when using the P_*XYMovement, P_*ZMovement, and P_RailThinker functions.