Cleanup in XPTAgents