fix and test case for #19