Task thread tweaks

Here are a few tweaks I made while chasing another bug. They shouldn't change behavior. r?

(I freely admit I haven't [figured out how to] run the tests yet.)