Fix infinite recursion in setup_credentials

I'm not sure this is the "right" way to solve this, but it works for me.