Added a lot of tests to previously uncovered sections.
Detected just one missing part when an error is intentionally added to the template.