Add test case.
Fix bug.