Fix for newline counting