Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1005)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1007)
@@ -1025,8 +1025,4 @@
     }
   }
-  if (m_apcSlicePilot->getVPS()->getNumAddLayerSets() == 0)
-  {
-    checkValueOfTargetOutputLayerSetIdx(m_apcSlicePilot->getVPS());
-  }
 #else
   checkValueOfTargetOutputLayerSetIdx(m_apcSlicePilot->getVPS());
@@ -2483,5 +2479,8 @@
   
   m_cEntropyDecoder.decodeVPS( vps );
-  m_parameterSetManagerDecoder.storePrefetchedVPS(vps);  
+  m_parameterSetManagerDecoder.storePrefetchedVPS(vps);
+#if R0235_SMALLEST_LAYER_ID
+  checkValueOfTargetOutputLayerSetIdx(vps);
+#endif
 }
 
@@ -3041,12 +3040,15 @@
   {
     // Check if the target decoded layer is the highest layer in the list
-#if 0
+#if R0235_SMALLEST_LAYER_ID
+    assert( params->getTargetOutputLayerSetIdx() < vps->getNumOutputLayerSets() );
+#endif
+#if !CONFORMANCE_BITSTREAM_MODE
     assert( params->getTargetOutputLayerSetIdx() < vps->getNumLayerSets() );
 #endif
     Int layerSetIdx = vps->getOutputLayerSetIdx( params->getTargetOutputLayerSetIdx() );  // Index to the layer set
-#if 0
+#if !CONFORMANCE_BITSTREAM_MODE
     assert( params->getTargetLayerId() == vps->getNumLayersInIdList( layerSetIdx ) - 1);
 #endif
-
+#if !R0235_SMALLEST_LAYER_ID
     Bool layerSetMatchFlag = true;
     for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++)
@@ -3060,4 +3062,5 @@
 
     assert(layerSetMatchFlag);    // Signaled output layer set index does not match targetOutputLayerId.
+#endif
     
     // Check if the targetdeclayerIdlist matches the output layer set
@@ -3249,5 +3252,7 @@
 {
   UInt smallestLayerId;
-  UInt targetOlsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx();
+  Int  targetOlsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx();
+  assert( targetOlsIdx >= 0 );
+
   UInt targetDecLayerSetIdx = vps->getOutputLayerSetIdx(targetOlsIdx);
   UInt lsIdx = targetDecLayerSetIdx;
