tests for #1063
fix #1059