Fix duplicate key + sort map