fix table type confusion (mainly between p5 and cd)