Fix issue 206. Add unit test.