Add test case for #1006