Fixed bug in username queries

Firstly, the test wasn't updating the "user" variable, so the test was returning
True when it shouldn't have. Secondly, the query wasn't returning the "name"
parameter, so the test was failing.