Added more conditionals

These make sure the torch and THC are only on when they are supposed to be.