Fixing the 'Too many open files' problem