Fixed it freezing due to 'invalid' window flags.