Fix bug in custodian.
Fix bug in custodian.

materialsproject/custodian,specter119/custodian,specter119/custodian,materialsproject/custodian,alberthxf/custodian,davidwaroquiers/custodian,specter119/custodian,materialsproject/custodian,xhqu1981/custodian