Some ternary statement fixes. Also a boolean expression simplification.