Fixed several errors with statistics and EOF