Modified the perimeter to be zero if a dimension of zero is given.