Ternary operators and fixes