Fix bug when unsetting credential var