Also, be much more careful and complete in recovering resources of terminated jobs. This commit was SVN r21199.