Fixes problems when the module is enabled without OCR.

Now checks if OCR is enabled before attempting to use it.