Various fixes in JobQueues and JobQueueTest.