Lots of bug fixes and implementation of chronological sorting.