Closing files after creating them so we don't get access errors.