Adding tests for #1013