Fix  sort in  to use  field instead of . Closes #287