Fixed handling batch in hdb_tool