Fixed EOF_check memory error.