Fix end of stream error for blocks