Bug fixes

Various fixes including creating a user.