Added a missing logic for processing if cannot find a proper rule for a subgoal during planning.