fix(autoload): Correct trait detection (closes #4754)