Correct condition branches, should fix #14

[ci skip]
Merge pull request #23 from bwong114/backport_conditional

Backport 'Correct condition branches, should fix #14'