apply zeromod-tesseract patch and do some fixes