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