Fixed a bug in isMoveValid

Capture moves were not being validated correctly