Fix edge case when swapping tiles