Fix InsertMetadata.incRank NPE. Implement some extension parsing