Fixed thread clean-up when ordered to stop or when work is complete.
Including class files for previous commit