Fixes for user management

Fixes #267 and fixes #268