Fix sort order when processing sort event.
Merge remote-tracking branch 'origin/fix-sorting'
1.4.0