Cleanup and bug fixes

- Hopefully fixed the spam bug.
- Cleanup.