Code cleanup in windows.c