Issue #197, add tests