Clear cached settings when resetting the configuration.

All credit goes to @PedroCunha for this - see issue #540.