             var channelClass:Class = getDefinitionByName(className) as Class;
             channel = new channelClass(channelId, uri);
             channel.applySettings(channelConfig);
-        
-            // WSRP support
-            // If we have an WSRP_ENCODED_CHANNEL in FlashVars, 
+
+            // If we have an WSRP_ENCODED_CHANNEL in FlashVars,
             // use that instead of uri configured in the config file
-            if (LoaderConfig.parameters.WSRP_ENCODED_CHANNEL != null)
-            {
+            if (LoaderConfig.parameters != null && LoaderConfig.parameters.WSRP_ENCODED_CHANNEL != null)
                 channel.url = LoaderConfig.parameters.WSRP_ENCODED_CHANNEL;
-                //trace("Using WSRP_ENCODED_CHANNEL: " + channel.url);
-            }
         }
         catch(e:ReferenceError)
         {

                "messaging", "unknownDestination", [ destinationId ]);
            throw new InvalidDestinationError(message);
        }
        
        return destination;
    }
        
    //--------------------------------------------------------------------------
    //
    // Static Internal Methods
    // 
    //--------------------------------------------------------------------------
     
    /**
     *  This method returns true iff the channelset specified has channels with
     *  ids or uris that match those found in the destination specified.

        {
            if (ObjectUtil.compare(channelSet.channelIds, getChannelIdList(destination)) == 0)
                return true;

            // if any of the specified channelset channelIds do not match then
            // we have to move to comparing the uris, as the ids could be null
            // in the specified channelset.
            var csUris:Array = [];
            var csChannels:Array = channelSet.channels;
            for (var i:uint = 0; i<csChannels.length; i++)
                csUris.push(csChannels[i].uri);

            var ids:Array = getChannelIdList(destination);
            var dsUris:Array = [];
            var dsChannels:XMLList;
