Enhances error handling and applies standard config