Better error handling, moved enums, improved chat