Fixed some code errors.