Test for #4017