Fixed bug with generalized velocities not being reset on checking for limit events