Unit tests for issue #398.