Had to replace all the gates, as well as the foundation walls surrounding them, but I was able to stick wall sections perpendicular into the sides of the gates, which created a seal when I replaced the foundation walls. Still not sure why I had to do all that, the replacement gates were in the exact same position as the old ones. Whatever, the castle walls are finished, and holy crap does the site look different.
Also still can't find the patch notes regarding feat/attribute points being reset. Only noticed that my attributes were reset when I was overladen with fish and being attacked by a crocodile. Lost a full stack of oil-fish that I dropped to get my encumbrance below 100% to fight the croc, and couldn't find the lootbag afterwards.
I guess it's time to get back to exploring and murdering everything I can find.
EDIT: Beat the Abyssal Remnant. Apparently shields do not block its attacks very well in first-person. Also I really don't like swordfighting, I'm too used to my pike.
EDIT2: Oh crap. I just realized something: I've been stacking foundation blocks on top of one another. The problem with that is if you destroy a foundation block, all foundation blocks on top of it are also destroyed. I first noticed this when replacing the gates, but I only now realized that it applies in the event of an attack. Instead, if anyone else is building similar fortifications, you should place ceiling blocks on top of each foundation, since foundations can be placed on top of the ceiling blocks. If the structure below is destroyed, a ceiling block may survive if adjacent blocks give it enough stability - foundation blocks cannot receive stability from the sides, hence they're destroyed if the structures below are lost.
EDIT3: Well it seems you can't actually put ceilings on top of foundations, though can put foundations on top of ceilings. Could have sworn you could do both. I wonder if four walls and a central pillar would work better.