Added test for #1041