Fix regression in wildcard includes

Resolves #7455.
Merge pull request #7498 from terminalmage/issue7455

Fix regression in wildcard includes