Fixed a few deactivation and initialization bugs. Also changed the file permissions to something more sane.