Fix cleanup and fix copy platform-client