Improve error handling in config.go