Fixed bugs at the last line.