Finally fix logic. Fixes #378.
Merge pull request #524 from s0undt3ch/issues/378

Finally fix logic. Fixes #378.