Integrate all windows and fix some bugs