added #387 test cases