Fix bugs in program.