Handle ternary operator properly