Fix ternary operator

Courtesy of @bigpet