Improved logic for referencing DLLs in plugins.