Merged more stuff from TeamHydra, fixed compile errors