Threaded restart fix

This isn't a problem with your PR, but should we check the return code of `remove`?