Fix for invalid text detection.