Corrected order of ternary operation.