Added test file and fixed bugs on an actual OCR system.