fixed ternaries in compliance with coding standards