Fixed warning thrown when there are 2 users with the same idnumber. Also made username lookup first.