fixes #2: detect improperly nested IfStatements