Fixes to your repo

I've fixed up your repo because there were regressions with your merge, and made a few fixes and improvements as well.  (I also reactivated the cout statements and threads, so beware if you do more testing.)  I have not compiled or tested this code yet, which is why I didn't just PR to the main repo.

If you add back tab characters, I will slap you in the face! =P