iterator: Fix invalid reads