Code cleanup
Chat channel scripting bug fix and cleanup