Changed how advance and eof work