Unit test for #1313