Adding tests for issue #1013

This pull request adds tests for issue #1013