Updated code for Tesseract 3.0.3