Improvements to error handler, added notfound.debug template