Can now handle files with no newline at the end, and subsections where the
parent section is not explicitly declared.