Fix bug in LocalJobs procedure.
Various minor changes.