some bug fixes related to the new username field and tests