Fixing the leaking log file descriptors.