Unit test and fix for issue #84

Issue #84 fix.