fixed checkmate check and fixed a couple of tests