Fixed the list-distinct procedures