Restricted minimum window size (OSX) and removed unnecessary code