Improved restart handling.