Merged with tomamic's chat cleanup