Fix a crash after changes that velocity is updated before position