Fixed bugs to do with file being the last section to be parsed