Error log was still showing the wrong file (obviously). Also added a function to the template layers class to prevent sending out the lower layers in case of errors (should avoid quite a bit of errors in the log)

Signed-off-by: emanuele <emanuele45@gmail.com>
Merge pull request #532 from emanuele45/really_fix_backtrace

Error log was still showing the wrong file (obviously). Also added a fun...

Merging it in because I need it... :P