Moved to as_compatible_shape() function