Fix the bugs in the npdm calculation of non-zero spin system.