Correct if else branches