Fixed table merge.
No ref
Added inheritance support.