fixes for jobs with multiple resources.  Added tests for multiple resource cases.