Fix user-defined types detection