Added test for #1042