Fix orderby in index and date conversion