Remove dead code, fix a checkmate check.