macOS version of sed doesn't recognize \r as special character. Replacing with \x0D substitution which works everywhere.