Fix a serious bug in the user db with nick changing, and add debug function to list database.