Fixed a few small bugs regarding deactivation