Handling of Excepitons in templates (fixes #11)