Added check for check and mate positions