Add comments, fix typo and one bug.