Various bug fixes and compile warning fixes

Fixed a few server crash bugs relating to accessing non-in game clients
and non-entity ids. Also cleaned up all compiler warnings across all
plugins.