[dev] Improved degenerate expansion in fermion.cpp.