Fix if statements in main