Prevent crash from stack overflow in doPhysics