Fixed logic error if uid == 0 then not checking for uniqueness