Test for #1340