Fixed eraseCredentials implementation