Automatically detect settings