Improve error handling a bit (so that if password hashing failed,
we will not put garbage into use configuration).