Fixes nearly all ischeck and legalmove bugs