Tests reproducting the bug described in #422
Fixes #422
Merge pull request #427 from erwinvaneyk/fix-422

Fixes #422