Fix for checkValid and placePiece in edge cases