Fixed bugs when else branch was reached