Making the parsing of sections and fragments more robust