Added ability to debug the processing
Corrected text offsets calculation