Improve handling of invalid settings data