Fix subtype relation to only consider number of array dimensions.
Improve removeReplicateMapping.
Fix map-scan fusion.