Fixed some mistakes in the code.