Fix/gh 795

This fixes GH #795. (Hope it links now.)

Please mind that this breaks an existing test as mentioned in c4f2105. I don't know what exactly the issue is and whether the test should be changed or this fix is not yet complete.