diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
index 137aaa9..d8a8760 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
@@ -84,11 +84,13 @@
         relationships.add(vfModuleRelationship);
 
         // vserver to image relationship
-        Relationship imageRel = buildRelationship(HeatBridgeConstants.AAI_IMAGE,
-                ImmutableMap.<String, String>builder().put(HeatBridgeConstants.AAI_CLOUD_OWNER, cloudOwner)
-                        .put(HeatBridgeConstants.AAI_CLOUD_REGION_ID, cloudRegionId)
-                        .put(HeatBridgeConstants.AAI_IMAGE_ID, server.getImage().getId()).build());
-        relationships.add(imageRel);
+        if (server.getImage() != null) {
+            Relationship imageRel = buildRelationship(HeatBridgeConstants.AAI_IMAGE,
+                    ImmutableMap.<String, String>builder().put(HeatBridgeConstants.AAI_CLOUD_OWNER, cloudOwner)
+                            .put(HeatBridgeConstants.AAI_CLOUD_REGION_ID, cloudRegionId)
+                            .put(HeatBridgeConstants.AAI_IMAGE_ID, server.getImage().getId()).build());
+            relationships.add(imageRel);
+        }
 
         // vserver to flavor relationship
         Relationship flavorRel = buildRelationship(HeatBridgeConstants.AAI_FLAVOR,
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index 3cf5a60..433aa0c 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -389,11 +389,8 @@
             String instanceName, ConfigurationResourceKeys configurationResourceKeys, RequestDetails requestDetails) {
         Configuration configuration = null;
         for (Configuration configurationTemp : serviceInstance.getConfigurations()) {
-            if ((bbName.contains("Fabric") && configurationTemp.getConfigurationSubType() != null
-                    && configurationTemp.getConfigurationSubType().equalsIgnoreCase("Fabric Config"))
-                    || (lookupKeyMap.get(ResourceKey.CONFIGURATION_ID) != null && configurationTemp.getConfigurationId()
-                            .equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID)))) {
-                lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, configurationTemp.getConfigurationId());
+            if (lookupKeyMap.get(ResourceKey.CONFIGURATION_ID) != null && configurationTemp.getConfigurationId()
+                    .equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID))) {
                 configuration = configurationTemp;
                 org.onap.aai.domain.yang.Configuration aaiConfiguration =
                         bbInputSetupUtils.getAAIConfiguration(configuration.getConfigurationId());
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
index d33e7ae..70365b7 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
@@ -85,12 +85,14 @@
         Map<String, Object> inputVariables = new HashMap<>();
         @SuppressWarnings("unchecked")
         Map<String, Object> vMap = (Map<String, Object>) variableMap.get("variables");
-        for (Map.Entry<String, Object> entry : vMap.entrySet()) {
-            String vName = entry.getKey();
-            Object value = entry.getValue();
-            @SuppressWarnings("unchecked")
-            Map<String, Object> valueMap = (Map<String, Object>) value; // value, type
-            inputVariables.put(vName, valueMap.get("value"));
+        if (vMap != null) {
+            for (Map.Entry<String, Object> entry : vMap.entrySet()) {
+                String vName = entry.getKey();
+                Object value = entry.getValue();
+                @SuppressWarnings("unchecked")
+                Map<String, Object> valueMap = (Map<String, Object>) value; // value, type
+                inputVariables.put(vName, valueMap.get("value"));
+            }
         }
         return inputVariables;
     }
