More work on error handling (rendering, templates)