Updated to accommodate Credential API changes