Fix incorrect variable name in credential saving.