Added support for username in user register function.