The With in line 160 is not closed so I got an error.
I closed it and it worked.
Also, I normally don't replace the curly quotes with the special character. Why are the quotes important to replace? I think I will comment out the code to replace the quotes as I like the look with the quotes better and my ebook seems to work fine.