Fixed bug where username is not written in case of non-anonymous user.