Improved error handling and configuration manager