tests for #1002