Fixed wrong usage of the ternary operator