Various updates to fix agent deploy