Bug fixes for tesseract and strirling gen.