Global on/off switch

* Minor changes and fixes