Fixed uniq function, also fixed the chaining that had broken when I move stuff around.