Fix a runtime error in Flexible Windows