Fix many bugs in chapter-04s.