Task thread tweaks

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