Fix precedence of ternary conditional