Fix #77
Add test for #77