Added rule checking on gem swapping