Correct bugs in file size and put the read on buffer correctly.