Fix bugs in identity providers manager.