Closes #3, with test to reproduce