Fixed error in SQL for jobs

Had owner id and job id mixed up. oops.

Also fixed auth error, and also fixed a couple other minor things