Fixes 'seek of closed file' error #2549
currently lazy=True fails with 'ValueError: seek of closed file'