Fixed syntax errors; improved check_job and check_user