Fix ebook and pdf generator