Platform agent cleanup

@edwardhunter please merge