Issue #19 reproducible with testcase
fix for issue #19