Fix some bugs, ready to improve the efficiency of program synthesis