Fix issue #88. Add unit test.