Refactored code according to changed AddPathToAutoload() function code.