Index: branches/SHM-5.0-dev/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- branches/SHM-5.0-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 548)
+++ branches/SHM-5.0-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 549)
@@ -81,5 +81,5 @@
   }
 #if SVC_EXTENSION
-  for( Int i = 0; i < m_tgtLayerId; i++ )
+  for( Int i = 0; i <= m_tgtLayerId; i++ )
   {
     if( m_pchReconFile[i] )
Index: branches/SHM-5.0-dev/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 548)
+++ branches/SHM-5.0-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 549)
@@ -530,4 +530,45 @@
 Int g_mvScalingFactor  [MAX_LAYERS][2] = {{0,0}, {0,0}};
 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}};
+
+std::string NaluToStr( NalUnitType nalu )
+{
+  switch( nalu )
+  {
+  case NAL_UNIT_CODED_SLICE_TRAIL_N:
+  case NAL_UNIT_CODED_SLICE_TRAIL_R:
+    return "TRAIL";
+  
+  case NAL_UNIT_CODED_SLICE_TSA_N:
+  case NAL_UNIT_CODED_SLICE_TSA_R:
+    return "  TSA";
+  
+  case NAL_UNIT_CODED_SLICE_STSA_N:
+  case NAL_UNIT_CODED_SLICE_STSA_R:
+    return " STSA";
+
+  case NAL_UNIT_CODED_SLICE_RADL_N:
+  case NAL_UNIT_CODED_SLICE_RADL_R:
+    return " RADL";
+  
+  case NAL_UNIT_CODED_SLICE_RASL_N:
+  case NAL_UNIT_CODED_SLICE_RASL_R:
+    return " RASL";
+
+  case NAL_UNIT_CODED_SLICE_BLA_W_LP:
+  case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
+  case NAL_UNIT_CODED_SLICE_BLA_N_LP:
+    return "  BLA";
+
+  case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
+  case NAL_UNIT_CODED_SLICE_IDR_N_LP:
+    return "  IDR";
+  
+  case NAL_UNIT_CODED_SLICE_CRA:
+    return "  CRA";
+
+  default:
+    return "     ";
+  };
+}
 #endif
 
Index: branches/SHM-5.0-dev/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibCommon/TComRom.h	(revision 548)
+++ branches/SHM-5.0-dev/source/Lib/TLibCommon/TComRom.h	(revision 549)
@@ -288,5 +288,6 @@
 #if SVC_EXTENSION
 extern Int g_mvScalingFactor  [MAX_LAYERS][2];
-extern Int g_posScalingFactor [MAX_LAYERS][2]; 
+extern Int g_posScalingFactor [MAX_LAYERS][2];
+std::string NaluToStr( NalUnitType nalu );
 #endif
 
Index: branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 548)
+++ branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 549)
@@ -45,5 +45,5 @@
 #define RANDOM_ACCESS_SEI_FIX            1
 #if SVC_EXTENSION
-#define MAX_LAYERS                       2      ///< max number of layers the codec is supposed to handle
+#define MAX_LAYERS                       8      ///< max number of layers the codec is supposed to handle
 
 #define O0194_DIFFERENT_BITDEPTH_EL_BL   1      ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled)
Index: branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 548)
+++ branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 549)
@@ -234,8 +234,9 @@
   //-- For time output for each slice
 #if SVC_EXTENSION
-  printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(),
+  printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP%3d ) ", pcSlice->getPOC(),
                                                     rpcPic->getLayerId(),
                                                     pcSlice->getTLayer(),
                                                     c,
+                                                    NaluToStr( pcSlice->getNalUnitType() ).data(),
                                                     pcSlice->getSliceQp() );
 #else
Index: branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 548)
+++ branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 549)
@@ -196,5 +196,5 @@
     if (m_cIlpPic[0] == NULL)
     {
-      for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++)  // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
+      for (Int j=0; j < m_numDirectRefLayers; j++)
       {
 
@@ -2038,4 +2038,7 @@
 {
   CommonDecoderParams* params = this->getCommonDecoderParams();
+
+  assert( params->getTargetLayerId() < vps->getMaxLayers() );
+
   if( params->getValueCheckedFlag() )
   {
Index: branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 548)
+++ branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 549)
@@ -3108,19 +3108,21 @@
 
 #if SVC_EXTENSION
-#if ADAPTIVE_QP_SELECTION
-  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d bits",
+#if ADAPTIVE_QP_SELECTION  
+  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, nQP %d QP %d ) %10d bits",
          pcSlice->getPOC(),
          pcSlice->getLayerId(),
          pcSlice->getTLayer(),
          c,
+         NaluToStr( pcSlice->getNalUnitType() ).data(),
          pcSlice->getSliceQpBase(),
          pcSlice->getSliceQp(),
          uibits );
 #else
-  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, QP %d ) %10d bits",
+  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP %d ) %10d bits",
          pcSlice->getPOC()-pcSlice->getLastIDR(),
          pcSlice->getLayerId(),
          pcSlice->getTLayer(),
          c,
+         NaluToStr( pcSlice->getNalUnitType() ).data().
          pcSlice->getSliceQp(),
          uibits );
Index: branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 548)
+++ branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 549)
@@ -1632,5 +1632,5 @@
     if (m_cIlpPic[0] == NULL)
     {
-      for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
+      for (Int j=0; j < m_numLayer; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
       {
         m_cIlpPic[j] = new  TComPic;
@@ -1699,5 +1699,5 @@
     if (m_cIlpPic[0] == NULL)
     {
-      for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
+      for (Int j=0; j < m_numDirectRefLayers; j++)
       {
         m_cIlpPic[j] = new  TComPic;
