fixed thread hanging issue khmer#384
fixed spelling error
Merge pull request #406 from ged-lab/fix/infinite_threadloop

fixed thread hanging issue