CAPE CANAVERAL, Fla. (AP) — A spacewalking astronaut successfully replaced a blurry camera outside the International Space Station on Friday, but had to contend with a balky jetpack and a frayed safety tether.

Both jetpacks and safety ties are crucial for saving a flyaway astronaut.

NASA said Joe Acaba was always securely attached to the orbiting outpost and never in any danger during the nearly seven-hour spacewalk.

But one of his tethers had to be replaced shortly after he and station commander Randy Bresnik floated outside. Mission Control noticed the red lifeline was frayed and worn. Bresnik went back to the air lock to get Acaba a spare.

Then five hours into the spacewalk, Mission Control saw that the right handle on Acaba's emergency jetpack was popped open — again. Bresnik once more went to his crewmate's assistance, even offering some tape to keep it down.

After consulting for several minutes in Houston, flight controllers declared the jetpack unreliable and ordered Acaba back inside, once he was done greasing the new robot arm on the space station's big robot arm. He finished the lube job, then headed in.

Bresnik acknowledged things didn't go as planned, "with all the stuff that happened today and the challenges we had." But he thanked everyone for their hard work and diligence.

In the end, only a couple minor chores were left undone.

"Great work today," Mission Control radioed as the spacewalk came to a close.

It was the third spacewalk in two weeks for U.S. astronauts. Bresnik went out on all three; he was accompanied by Mark Vande Hei to install the new robotic hand on Oct. 5 and lubricate it on Oct. 10.

Each spacewalker wears a jetpack for use in an emergency. It's available in case an astronaut's multiple tethers fail and allows the spacewalker to fly back to the station. It's been tested by orbiting astronauts — years ago — but never called into urgent action.

Earlier, Acaba provided necessary focus to the space station's robot arm.

He unbolted a blurry camera from the new robotic hand installed two weeks ago. He then popped in a spare, which flight controllers quickly tested from Houston. The replacement provided crisp, clear views.

Sharp focus is essential when the space station's robot hand grabs an arriving supply ship and anchors it. The next delivery is a few weeks away, prompting the quick camera swap-out.

Orbital ATK, one of NASA's commercial shippers, plans to launch a cargo ship from Virginia on Nov. 11.

Acaba and the station's commander, Randy Bresnik, were supposed to go spacewalking earlier this week. But NASA needed extra time to add the camera repair to their chores.

Friday's spacewalk — expected to be the last one for the year — also saw the astronauts installing a high-definition camera, replacing a fuse and removing thermal insulation from spare electronics. Early next year, astronauts will replace the hand on the opposite side of the 58-foot robot arm, Canada's main contribution to the space station. The original latching mechanisms are showing wear and tear since the arm's launch in 2001.

The 250-mile-high complex is currently home to three Americans, two Russians and one Italian.

A one-time high school and middle school teacher, Acaba is the first astronaut of Puerto Rican heritage; his parents were born there. He ventured out on Friday's spacewalk as the station soared above the hurricane-ravaged island, where much of his extended family lives.

"There's a whole line of people looking up and smiling today as you get ready to head out the door," Bresnik told him.