Fixing use of return_value in ternary operator