teaching_edit: fix bugs