a fix and more test cases