Fix the window controls

Fixed the minimize, maximize/restore and close window controls. Not 100%
acceptable, but good enough.