Add test for #166 and #193