Fix task ID assignment

This makes things less broken, hopefully.