Fixed EOF bug in fgetString