Bugfix in extract script