Fixed bug in TestWindow