change rules, add tests
Merge pull request #375 from mimmi20/issue-370

Fixes #370