fix(autoload): Changed checks of relative directories in addDirectory() (closes #5191)