Rectified some mistakes in the code.