toBytesUnique introduced to remove duplicates.