Improved #2399 regression test.