This was broken when the loading of external resources for the HTML output was added. This fix should also improve compatibility with py2exe.