Fix some bugs in the usermanager relating to error output and a crash