Fix complex types detection