Fixed a problem where the wrong sort field was used.