The barrel is pinned to the barrel extension, and that pin also aligns the barrel with the receiver. When you take off the barrel nut, you can slip out the barrel from the upper and you will see how the pin fits into a notch in the upper. This notch should not be chewed up or damaged, you can tell by looking at it if it has been mucked up or not. If the notch looks undamaged and there are no other signs of damage, put the barrel back in (headspace is set by the barrel extension so you will not alter headspace by removing the barrel) and tighten it up. I had a loose barrel nut and it had been torqued within specs. The nut broke loose at 38 or 40 ft-lbs but after I inspected to make sure nothing was wrong, I tightened it up to the next gas port hole, which came into alignment at 70 or 75 pounds (don't recall which right now) on the 4th or 5th try (I did not want to go higher than that and I found that when I backed the nut off and retightened, when I got to the same setting the gas port was just a little closer to be aligned, so I backed off the nut and tried again. Once it went into alignment I put it all back together and this time the barrel was tight like it should be and did not twist when I put on the FS.