Bug fixes

Fixed errors with Event handling
Fixed errors Amaranth brought to my attention with unloading a plugin
but not plugins that depend on it.