Fix extraction script