Fixed nesting bug

else ifs where being counted as being nested within each other