Change sort order to a "stable" sort. Fixes #14