don't lowercase keys in 'config'; fix clientId handling