attempt to fix issue 3479 with min( , default_sort_key) and edited test cases