Test case for issue 1239
Test case for issue 1239: fix + better error reporting
Merge pull request #9 from pveber/test-for-issue-1239

Test for issue #1239.