fix and test for #7