Fix deleting windows and cleaning up flycheck errors