Change block-index to 0-based, also fixes streaming off-by-one bug.