tests for #1087