Issue #14 fix + tests