Fixing enumeration compilation errors, and renames.
Rename Events, fixing compile errors.
Fix various compilation warning and errors.