Fix count_lines fn