Former House Speaker Newt Gingrich on Sunday said that GOP nominee Donald Trump has "gotten the message" after several missteps over the past week.

Trump had a week full of problems, such as accepting a Purple Heart from a veteran and refusing to endorse Speaker Paul Ryan and Sen. John McCain.

But Gingrich on "Fox News Sunday" said that Trump's decision near the end of the week to endorse both Ryan and McCain are "steps back into the in."

"It's very tricky if you've never run for public office to jump from being a businessman to being one of the two running for president, and he's made some mistakes," Gingrich said.

He also said that Trump is still far from disqualifying himself for the presidency.

When Rep. Xavier Becerra, D-Calif., on the same show was questioned on Hillary Clinton's emails, he turned the conversation to Melania Trump's immigration story and the nominee's unwillingness to release his tax returns.

But Gingrich defended Mrs. Trump's immigration status, which has come under question this week after allegations arose that she worked in the U.S as a model without the proper papers.

"His mother was a legal immigrant. His wife was a legal immigrant. He employs legal immigrants. He just likes his immigrants to be legal," Gingrich said.