Fixed restarting issues.