Pass user to store_token, not username

I'm not sure if this is the right fix - I'm not totally clear on when username is called, but some change in this area so that a blank user name isn't passed to store_token seems needed. Part fixes #165.