Moved the WMS layer name encoding to be done before the sub datasets URLs are created.