tweak #13 and add unit test for #12