Fix handling of rules with multiple targets.