Fix credential saving