Completed backport of dimensions.