Core loader: Fixed loading issue with nested plugins (fixes #4457)