Bug fix in the extractor, and AM batch tools