Added test case for #1006
Fixes #1006