Fix issue #204 and add test.