fix redundant first line count

switch line counters to internal linkage