Added ternary and fixed a typo