Changed metadataObjectTypesForOptions to function.