Fix loss of static dependencies for generic rules from one run to another.