Fixed precedence issue in ApplyVelocities thread function.