Fixed windows and other bugs