San Francisco 49ers running back Joe Williams has been bitten by the injury bug again.

Head coach Kyle Shanahan announced Sunday that Williams sustained a rib fracture and “very bad” bruising to his midsection during San Francisco’s 16-13 loss to the Houston Texans. Shanahan said that William’s injury was initially thought to be a hip pointer but tests conducted the next day revealed different issues.

“It was his hip, so he thought it was a hip pointer at first,” Shanahan said. “He thought he could go through it, and we were rotating guys anyways. He was hurting, and we were about to make a change with our original plan.

“Just sleeping on it last night, he came in this morning and it was hurting worse than a hip pointer should. They looked into some things and found some other stuff.”

For Williams, this will be his second consecutive preseason marred by injury. In 2017, an ankle injury in training camp landed him on season-ending injury reserve, costing him the entire regular season. This season, Williams entered camp healthy and ready to battle for the team’s third running back position, but through two preseason games, he hasn’t done much to make the 53-man roster.

With 19 total carries, Williams has amassed only 45 yards and no touchdowns. That sum includes his eight-carry, 18-yard performance against Houston.

If Williams’ margin for error wasn’t tight enough, the 49ers brought in veteran running back Alfred Morris last week after injuries to Matt Breida and Jerick McKinnon shortened their rotation at the position. Morris had two years of experience in Shanahan’s system, playing for Shanahan for two years while he was the offensive coordiantor with the Washington Redskins.

San Francisco will have a few options when it comes to what they will do with Williams in the next few weeks. The most obvious would be simply cutting the 24-year-old back, but the team could also place Williams on IR again or place him on the Physically Unable to Perform list to start the season.

With all things considered, Williams’ future with the team is anything but secure. And as it currently stands this latest injury just adds another wrinkle to his eventful tenure with the 49ers.

Magnuson out with hamstring

Shanahan announced that offensive lineman Erik Magnuson could miss significant time with a hamstring injury sustained Saturday night.

“[Magnuson] is going to be out for a while,” Shanahan said. “It’ll go early into the year. He had a hamstring strain, which was a bad one. If I had to give you guys a time, six to eight weeks, but, who knows. It’s going to be a while.”

Magnuson, Joshua Garnett and Mike Person have been the three front runners for the starting role at right guard. Former Dallas Cowboys guard Jonathan Thomas has also been considered a candidate for the job but he is still coming back from a knee injury.

In Garnett’s case, he, too, is making his return after suffering a knee contusion earlier in camp. Seeing his first in-game snaps of the preseason, Garnett played well enough to stay in the picture to become the starter but Shanahan said he still needs to see more.

“He did some good things, he did some bad things, like everybody,” Shanahan said. “He went through a whole week of practice where he got a lot more reps, was able to put those consecutive days together, got a chance to go in and play in the game where he had a number of plays and he felt great today. I think that was very encouraging.”

Beathard has a foot sprain

Backup quarterback C.J. Beathard saw a lot of field time Saturday, but not without cost, as the second-year QB left Houston with a sprained foot according to Shanahan.

“I don’t think he should be in a boot,” Shanahan said. “I know we’ve got to re-evaluate it Tuesday. I didn’t notice it on the field, but definitely saw it on the tape. It looked pretty bad.”

Beathard played the most of any 49ers quarterback Thursday. Under center for a total of 29 plays, Beathard was 10-for-17 passing and threw for 82 yards.