BUG: iterating inconsistently caused data corruption.