Test for #1058.