Removed unnecessary ternaries

Fixes #2554