Handle client-provided username correctly

Fixes #1
Merge pull request #2 from gavllew/master

Handle client-provided username correctly