I encountered an issue using getMgmtDisc. Specifically, when there is missing 10-K in the year, it returns
Error in XML::free(doc) : object 'doc' not found
and terminates its function without moving to the next document.
I guess there is an issue in line 177 but I am not sure whether it is.
rm(f.text); XML::free(doc)