Fixed errors in if else ... statements