Issue #52, add tests