Refactored code according to changed AddPathToAutoload() funcntion code.