Fix incorrect 'if' optimization
Merge pull request #72 from mpeterv/fix-if-optimization

Fix incorrect 'if' optimization