Fixed a bug in toggle, clarified some of the booleans, added debug messages.