try to fix issue 3479 and edit test cases