Added metadata sorting.