Fix buffered reader issues