Fixes to date sort order