Fixed a checkmate bug