Updated

The all-night terror attack on the U.S. Consulate that killed four Americans last month in Libya was "not optimal," President Obama said Thursday.

The president made the comment during an appearance on Comedy Central's "The Daily Show." The president defended his administration's handling but vowed to get to the bottom of what happened, after host Jon Stewart pressed him on the administration's initial response to the tragedy.

Stewart said: "I would say and even you would admit it was not the optimal response -- at least to the American people as far as all of us being on the same page."

Obama, though, responded: "Here is what I will say -- if four Americans get killed, it is not optimal. And we are going to fix it." U.S. Ambassador Chris Stevens and three other Americans were killed in the strike.

Obama went on to say: "And what happens during the course of a presidency, you know, the government is a big operation -- at any given time, something screws up and you make sure you find out what's broken and you fix it."

More On This...

The president in recent days has aggressively defended the administration's handling of the incident, while acknowledging officials' understanding of what happened evolved in the days following the strike. The administration has taken heat over security requests that were denied in the run-up to the Sept. 11 attack, and for asserting at first that the strike was a spontaneous demonstration spun out of control in response to an anti-Islam film. Officials now say it was a coordinated act of terrorism.

Obama, though, said Thursday "we weren't confused about the fact that four Americans had been killed. I wasn't confused about the fact that we needed to ramp up diplomatic security around the world right after it happened."

Obama also said, "I wasn't confused about the fact that we were going to hunt down whoever did it and bring them to justice. So, as I said during the debate, nobody is more interested in figuring this out than I am."

The issue of Libya flared during the latter half of that debate on Tuesday. Obama told Romney that the suggestion anyone in his team would "play politics" on the issue is "offensive."

However, Romney sharply questioned Obama's actions in the aftermath of the strike -- including his decision to go on a fundraising tour shortly after the attack.

"The president, the day after that happened, flies to Las Vegas for a political fundraiser," Romney said. "These actions taken by a president and a leader have symbolic significance."