Corrected bug in updating linecount