some fixes to ES bulk_restore script