Minor changes to OCR algorithm