Sort and deduplicate results, ref #14