Fixes #410.
Added a test case related to issue #410.