Fix buggy parsing of ternary statements