Fix recursive restart functionality.

This patchset makes recursive restarts work for at least some basic cases.