Revert "Some changes to fix random restarts"

This reverts commit 8ce9cb6274288e5fcdf1e25fe023050ec533cb7c.