Add a regression test for #1459.