Clean up config access and fix tests