Fix forgotten file-close()

 - Fixed areas where I forgot close open files