Merge pull request #797 from wenxuwan/master

Imp: try to fix too many files open error