Fixed update Bug and many minor changes

such as creating a debug template for every major template.
...