Added more debugging measures, fixed work submission.