Fixed issues with checkmate handling