Add a test case for #407

Closes #407