Simplify boolean expressions
Merge pull request #500 from naoliv/pull15

Simplify boolean expressions