Sort correctly to remove duplicates

Ticket:	#2457
Merge:	releng/9.1.0