Updated ChatExample to work correctly and minor cleanup.