fix some errors for long-term running