Code cleanup and halfway fix of the ball rotation.