Adjusted race conditions with reading count values.