Changed grep -v against $logfile to throw out lines with control characters.