Fixes recursive tree detection to include base types.