Add better error handling for config scanning.