Some bugs in win checking