Improve chm generation workaround.