Fixed a number of restart-related bugs. Should be fine now... I think. (This is turning into a mess :/)