fix typo and unused code.
add test.
edit comment.