OCR Performance Tweaks

Added some error checks and improved OCR speed by a small amount.