Fix for wrong path being returned for plugins. Fix to avoid stack overflow for dependency checks.