Fixed crash when moving off the board or in an invalid direction.