fix bug_23 and add more tests