Added code in MetadataObjectForURL + some minor changes