Drop warnings

Drop some 'unused' warning and changed populate() to use an unsigned int as uid() returns an unsigned it. Also check the user is valid.