Added check for square cells when mapping=cartesian