Fixed camera controls acting weird on different window systems. Cleaned up camera control code.