Improved error handling. Adding a settings provider.