Even more finetuned fix for cgmin error.
Even more finetuned fix for cgmin error.

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