Attempt to fix a 'too many open file handles' issue