[Rubocop] Fix things it broken
Fix leaking file descriptors