Chat: Cleanup and API change fix