Remove unused method.
Rename "chunk" parameter to "chunks_count".
Replace call of obsolete Aggregates method (but script contains an error).