fixes in extraction script