fix error handler and template names.