Fix unique = True error and account for users without username, only uid.