Check Civ4BuildingInfos.xml. If any building has iConquestProb with a value other than 100 it can potentially cause the bug. If a building shouldn't be captured it has to be registered as such in CvFinalFrontierEvents.py in the onCityAcquired method (I think that's the right method, at least).
You can open python .py files with notepad or any other text editor.
Check Civ4BuildingInfos.xml. If any building has iConquestProb with a value other than 100 it can potentially cause the bug. If a building shouldn't be captured it has to be registered as such in CvFinalFrontierEvents.py in the onCityAcquired method
Any building that gives a fortification bonus (such as Star Fortress) needs to be in that list as otherwise the bug will occur. It won't happen with worldbuilder, as buildings added in worldbuilder won't be on any planet, and the bug happens when the python encounters a building on a planet that isn't on the master building list, usually because the building on the list was removed in system capture, but civ doesn't know to remove it from the planet, so Final Frontier does this at the same time. If Final Frontier doesn't remove the building from the planet, that's when problems occur.