fix some bugs for Ch04