Support automatic error detection & restarting if needed
Fix bug with no data.