v1.0.2: fixed a bug in function sort_and_uniquefy