Fix log reading bug