Issue #80, add tests