Fix bug on isValidSwapCoordinates method