Fix sorting so that it respects sorting from the Pages index. Closes #15