Fixed a couple of bugs in the ingestion scripts.