Fixed compilation and added some stuff in movement handling