Hi, it might be a bug in the exlibris code* or a problem with the book. Has the latter been validated (with an EPUB validator like FlightCrew or EpubCheck)?
I can have a look at the problem if you send me the EPUB (if it does not infringe any copyright). In case, you can send me a link or the EPUB itself at alberto AT albertopettarin.it , thanks.
* I have purposedly avoided standard XML parsers (which require a well-formed input) in order to be lenient towards slightly-incorrect content/toc files (I tested it on a couple of invalid EPUBs as well); but clearly my code can still fail.