Nigel Wright and Mike Duffy's lawyer sparred in court today over what the former chief of staff meant in an email when he said "sweet" following the senator's public admission he may have made a mistake with his living expenses.

Donald Bayne focused on a flurry of emails involving members of the Prime Minister's Office (PMO) leading up to and following Duffy's admission. On Feb. 22, 2013 Duffy went public about the expense controversy, saying he "may have made a mistake" by claiming the housing allowance for his Ottawa home, and that he would pay the expenses back.

The PMO had been attempting to quash the controversy that had arisen because Duffy, a P.E.I. senator, had designated his home in that province as his primary residence. The made him eligible to claim living expenses for his Ottawa residence, even though he spent most of his time in Canada's capital.

One email, sent by Wright to members of the PMO following Duffy's public admission, says: "I appreciate the work this team did on this. One down, two to go (and one out.)."

Wright testified that that email referred to other senators facing residency or expense-related issues. The "one down" referred to Duffy, the "two to go" were Senators Pamela Wallin and Dennis Patterson, while the "one out" was suspended Senator Patrick Brazeau.

Harper's then-director of communications Andrew MacDougall replied in an email: "Yay, this is fun" and added that Duffy had just told reporter Tom Clark that he was under "strict instructions from the centre not to talk to Global. Helpful."

To that, Wright replied: "Sweet."

On Monday Wright testified "sweet" conveyed his frustration that he thought Duffy had told Clark something that wasn't true.

Wright said MacDougall's "this is fun" comment also was an expression of frustration with Duffy.

But Bayne rejected Wright's interpretation.

"Those aren't terms of frustration. Those are terms of exultation.Those are terms that you are all now gloating inside the PMO that you pulled this one off," he said.

"I think you're misreading the emails," Wright said.

"I think I'm reading them the way any Canadian would read them," Bayne shot back.

Crown prosecutor Mark Holmes then stood up to interject: "For what it's worth, that isn't how I read them."

And in an email to CBC News, MacDougall said his "this is fun" email was "dripping in sarcasm."

Wright has faced tough questioning from Bayne, who has painstakingly gone through emails sent and received by Wright during his time as chief of staff, all related to a scheme to have the Canadian public believe that Duffy himself had paid back his expenses. Bayne had argued that Wright forced Duffy to accept the deal.

Although Wright has testified that Duffy may have done nothing legally wrong by making those claims, and that he may have been entitled to those claims, Wright said he and the prime minister thought they were inappropriate and the general public would likely have a similar view

Members of the PMO, including Wright, wanted Duffy to agree to a deal in which he would admit he had made an unintentional mistake and say that he would repay the expenses, at the time thought to be $32,000.

Nigel Wright, former chief of staff to Stephen Harper, arrives at the Ottawa Courthouse Monday for the fourth day of his testimony in the fraud trial of Mike Duffy. (Fred Chartrand/Canadian Press)

In turn, Conservative Senator Irving Gerstein, who was chair of a Conservative Party fund, had arranged with Wright that the fund would be used to secretly cover Duffy's expenses. Duffy, by agreeing to go along with the plan, would have his name kept out of an audit being conducted by the outside firm Deloitte.

Court heard last week how Duffy had continued to resist the deal, claiming he had done nothing wrong.

But the deal went sour when it was learned Duffy's expenses actually totalled $90,000. Gerstein would no longer allow money from the fund to be used to cover the expenses. That's when Wright personally intervened with his own money, court has heard.

Wright denies he lied to PM

Earlier, Wright denied he lied to Stephen Harper when he told the prime minister that Duffy was going to pay back his expenses when the claims were actually going to be covered by a fund of the Conservative Party.

Bayne questioned Wright about a conversation he had with Harper about Duffy's expenses. Wright has previously testified that Harper wasn't informed that the Conservative fund would be used to pay off Duffy's expenses. Instead, Wright has said he told Harper that Duffy would repay the expenses.

Bayne asked Wright why he would lie to the prime minister.

"I don't think I lied to the prime minister," Wright said.

"I don't feel it was lie. I just felt it wasn't on my list of things I needed to check with him."

"That's not true and you know it wasn't true. Duffy was not going to repay," Bayne replied.

He asked Wright if he didn't think there was a difference between Duffy repaying and the money coming secretly from the Conservative fund.

Senator Mike Duffy has pleaded not guilty to 31 charges of fraud, breach of trust and bribery related to expenses he claimed in 2013 as a senator and later repaid with money from Wright. (Fred Chartrand/Canadian Press)

"I didn't think that was a distinction that was that significant," Wright said, adding what was important was that the expenses were paid back.

Duffy has pleaded not guilty to 31 charges of fraud, breach of trust and bribery related to expenses he claimed in 2013 as a senator and later repaid with money from Wright.

Wright's fourth day of testimony comes on the 40th day of Duffy's judge-only trial, which resumed last Wednesday after breaking on June 18. It was the second hiatus of the high-profile trial, which began April 7 in the Ontario Court of Justice in Ottawa. This third phase will continue until Aug. 28, and, with more time assuredly needed, break until it would resume again in mid-November.