Various cleanups for windows