Fix #779 improve uniq behavior