Test for #5640