Previous fix for newlines did not cover all cases