Fix several bugs uncovered after testing against different texts
Fix display issue in file not found error