Bug fixes and code cleaning

- Random cleaning
- Don't clear the wrong event for sync player chat