Fixed problem with exception being thrown from minimize.

Still to do: handle keyboard input, full-screen mode, and clamp rotation values.