Fixed a lot of bugs with the torch system.