manual reapply of 68be42d271591a47681fa15e2c3d5253a4141444 changes to better support multiTable DB/CP.