Replaced some ternary operations with bools.