fix a set of bugs around restarting reactor