Fix issues involving plans for the agent.

Fix issue where a plan would never be constructed as all rows
were skipped. The agent believed each state already had a path
due to a comparison with null instead of the empty string. Set
initial planIndex to -1, as the planIndex is incremented before
the plan is accessed. cleanupFailedPlan now punts on plans of size
1. cleanupFailedPlan now sets the plan to null and the planIndex
to -1. Change check that sees if a plan was successful to check
if the plan is null to handle the case where a failed plan needs
to be cleaned up.