fix nested sections

Multiple nested sections were not being parsed correcly