added generated __free_unpacked(), minor script rework