Add test for #16
Fix #16