Papa John's swung to a loss in the first quarter as the steps the embattled pizza chain is taking to bolster its business and legal fees hit earnings.

But excluding these charges, the company topped Wall Street's expectations. Shares seesawed in extended trading Tuesday, sometimes rising as much 5% before trending back downward.

The company reported first-quarter net loss of $3.80 million, or 12 cents per share, down from net income of $17.4 million, or 52 cents per share, a year earlier.

Last July, sales cratered after it was reported that founder John Schnatter used the n-word on a conference call. After he was ousted as chairman, Schnatter sued the company that he founded. In March, he settled with Papa John's, dismissing his lawsuits and agreeing to not seek reelection on the board. Schnatter is now considering selling his 31% stake in the pizza chain, according to an SEC filing on Monday.