Fixed bug in physics update