fix some errors for long-term running
Merge pull request #1 from HParker/fix

fix some errors for long-term running