Fix compile issues in agent UT