Some fixes for user management