Don't use ternary if statements. Fixes #8784