Bug 3642: sorting does not work - fixed