Fixed some minor bugs in dialog_subject and dialog_learn_period