Issue 365

I have changed and added some rules and added some tests. This should solve Issue #365.