Fixed autoload function to match previous refactoring.