Chances are the front/back sectors of one or more of the linedefs involved is set incorrectly. I find the best solution is to go through, check manually what the front/back sector of each linedef is (Roll your cursor over the sector that should be the "front" and check the number at the bottom of the screen) then go back, and manually set the "front/back sector" values of each of the linedefs until you find the one that was set incorrectly.