Fix ternary operator and parameter passing