Fixed problem with cleaning the username when the application is using a...

... custom username field.