panic fix (issue #33) with test case