Fix and test for #257