Fix incorrect 'if' optimization

Due to a typo currently the transformation used is `if A (if B C D) C -> if (if A B false) C C`, which is incorrect.