fix and test for #41