Fixed some little bug, add some comments.