diff --git a/LArCalorimeter/LArRawConditions/CMakeLists.txt b/LArCalorimeter/LArRawConditions/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4f36de6989a3faf9cbfea55c2f5da9ac9fba8728
--- /dev/null
+++ b/LArCalorimeter/LArRawConditions/CMakeLists.txt
@@ -0,0 +1,49 @@
+################################################################################
+# Package: LArRawConditions
+################################################################################
+
+# Declare the package name:
+atlas_subdir( LArRawConditions )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          Calorimeter/CaloIdentifier
+                          Control/AthenaKernel
+                          Control/CLIDSvc
+                          Control/DataModel
+                          Control/SGTools
+                          Control/StoreGate
+                          Database/AthenaPOOL/AthenaPoolUtilities
+                          DetectorDescription/Identifier
+                          GaudiKernel
+                          LArCalorimeter/LArElecCalib
+                          LArCalorimeter/LArIdentifier
+                          LArCalorimeter/LArTools )
+
+# External dependencies:
+find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+
+# Component(s) in the package:
+atlas_add_library( LArRawConditions
+                   src/*.cxx
+                   PUBLIC_HEADERS LArRawConditions
+                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                   LINK_LIBRARIES CaloIdentifier AthenaKernel DataModel SGTools AthenaPoolUtilities Identifier GaudiKernel LArIdentifier StoreGateLib SGtests LArToolsLib
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+
+atlas_add_dictionary( LArRawConditions1Dict
+                      LArRawConditions/LArRawConditionsDict1.h
+                      LArRawConditions/selection1.xml
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier AthenaKernel DataModel SGTools StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArToolsLib LArRawConditions )
+
+atlas_add_dictionary( LArRawConditions2Dict
+                      LArRawConditions/LArRawConditionsDict2.h
+                      LArRawConditions/selection2.xml
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier AthenaKernel DataModel SGTools StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel LArIdentifier LArToolsLib LArRawConditions )
+
+# Install files from the package:
+atlas_install_python_modules( python/*.py )
+atlas_install_joboptions( share/*.py )
+
diff --git a/LArCalorimeter/LArRawConditions/src/LArOFCComplete.cxx b/LArCalorimeter/LArRawConditions/src/LArOFCComplete.cxx
index 8f326dd8adb58ad65ea63b839c099436a0cd6832..e447f6a8d15b34d512534641663c989c59e9979f 100755
--- a/LArCalorimeter/LArRawConditions/src/LArOFCComplete.cxx
+++ b/LArCalorimeter/LArRawConditions/src/LArOFCComplete.cxx
@@ -148,7 +148,7 @@ void LArOFCComplete::dumpOFC(std::string output_file_name) const {
       for ( ; it_chan !=it_chan_e ;++it_chan  ) {
 	  const LArOFCP1&   chunkOFC = *it_chan ;
 	  unsigned int     chID     = it_chan.channelId().get_identifier32().get_compact();
-	  fprintf( f , "---------------------- Gain = %1d ; Channel = %10x ----------------------\n", 
+	  fprintf( f , "---------------------- Gain = %1u ; Channel = %10x ----------------------\n", 
 		   iGain, chID ) ;
 	  unsigned nTbin = chunkOFC.OFC_aSize() ;
 	  assert( nTbin == chunkOFC.OFC_bSize() ) ;
@@ -156,7 +156,7 @@ void LArOFCComplete::dumpOFC(std::string output_file_name) const {
 	  for ( unsigned kBin=0 ; kBin<nTbin ; kBin++ ) {
               unsigned nSample = (chunkOFC.OFC_a (kBin)).size() ;
 	      assert( nSample == (chunkOFC.OFC_b (kBin)).size() ) ;
-	      fprintf( f , "\t%2d\t |" , kBin ) ;
+	      fprintf( f , "\t%2u\t |" , kBin ) ;
 	      for ( unsigned kSample=0 ; kSample<nSample ; kSample++ ) {
                 fprintf( f , "\t%8.3f" , chunkOFC.OFC_a(kBin)[kSample] ) ;
 	      }
diff --git a/LArCalorimeter/LArRawConditions/src/LArWaveHelper.cxx b/LArCalorimeter/LArRawConditions/src/LArWaveHelper.cxx
index 5b0cb149ecc1fa7ff9c511dcfc67a4f3ca451f12..221578e095dc795c7c96f873d5411d591ca4f85d 100755
--- a/LArCalorimeter/LArRawConditions/src/LArWaveHelper.cxx
+++ b/LArCalorimeter/LArRawConditions/src/LArWaveHelper.cxx
@@ -335,7 +335,7 @@ LArWave LArWaveHelper::subSample(const LArWave& theWave,unsigned Nfirst,unsigned
 {
   unsigned length = theWave.getSize() ;
   if ( length <= 0 ) return LArWave() ;
-  unsigned Nsamp = (int)ceil( (length-Nfirst)/deltaN ) ;
+  unsigned Nsamp = (length-Nfirst + (deltaN-1)) / deltaN ;
   LArWave w( Nsamp , deltaN*theWave.getDt() ) ;
   for (unsigned i=0;i<Nsamp;i++) {
     unsigned j = Nfirst + i * deltaN ;