fixes for User-defined table-type handling