Fix warnings when sorting empty collection of pages