c884a03
diff --git a/src/cr2image.cpp b/src/cr2image.cpp
c884a03
index 516e170..8a752b0 100644
c884a03
--- a/src/cr2image.cpp
c884a03
+++ b/src/cr2image.cpp
c884a03
@@ -107,8 +107,6 @@ namespace Exiv2 {
c884a03
             throw Error(3, "CR2");
c884a03
         }
c884a03
         clearMetadata();
c884a03
-        std::ofstream devnull;
c884a03
-        printStructure(devnull, kpsRecursive, 0);
c884a03
         ByteOrder bo = Cr2Parser::decode(exifData_,
c884a03
                                          iptcData_,
c884a03
                                          xmpData_,
c884a03
diff --git a/src/crwimage.cpp b/src/crwimage.cpp
c884a03
index 232919c..58240fd 100644
c884a03
--- a/src/crwimage.cpp
c884a03
+++ b/src/crwimage.cpp
c884a03
@@ -131,15 +131,8 @@ namespace Exiv2 {
c884a03
             throw Error(33);
c884a03
         }
c884a03
         clearMetadata();
c884a03
-        // read all metadata into memory
c884a03
-        // we should put this into clearMetadata(), however it breaks the test suite!
c884a03
-        try {
c884a03
-            std::ofstream devnull;
c884a03
-            printStructure(devnull,kpsRecursive,0);
c884a03
-        } catch (Exiv2::Error& /* e */) {
c884a03
-            DataBuf file(io().size());
c884a03
-            io_->read(file.pData_,file.size_);
c884a03
-        }
c884a03
+        DataBuf file( (long) io().size());
c884a03
+        io_->read(file.pData_,file.size_);
c884a03
 
c884a03
         CrwParser::decode(this, io_->mmap(), io_->size());
c884a03
 
c884a03
diff --git a/src/orfimage.cpp b/src/orfimage.cpp
c884a03
index 25651bd..9bd7a02 100644
c884a03
--- a/src/orfimage.cpp
c884a03
+++ b/src/orfimage.cpp
c884a03
@@ -119,8 +119,6 @@ namespace Exiv2 {
c884a03
             throw Error(3, "ORF");
c884a03
         }
c884a03
         clearMetadata();
c884a03
-        std::ofstream devnull;
c884a03
-        printStructure(devnull, kpsRecursive, 0);
c884a03
         ByteOrder bo = OrfParser::decode(exifData_,
c884a03
                                          iptcData_,
c884a03
                                          xmpData_,
c884a03
diff --git a/src/rw2image.cpp b/src/rw2image.cpp
c884a03
index 07de437..5922602 100644
c884a03
--- a/src/rw2image.cpp
c884a03
+++ b/src/rw2image.cpp
c884a03
@@ -130,8 +130,6 @@ namespace Exiv2 {
c884a03
             throw Error(3, "RW2");
c884a03
         }
c884a03
         clearMetadata();
c884a03
-        std::ofstream devnull;
c884a03
-        printStructure(devnull, kpsRecursive, 0);
c884a03
         ByteOrder bo = Rw2Parser::decode(exifData_,
c884a03
                                          iptcData_,
c884a03
                                          xmpData_,
c884a03
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
c884a03
index de66068..98da12b 100644
c884a03
--- a/src/tiffimage.cpp
c884a03
+++ b/src/tiffimage.cpp
c884a03
@@ -185,10 +185,6 @@ namespace Exiv2 {
c884a03
         }
c884a03
         clearMetadata();
c884a03
 
c884a03
-        // recursively print the structure to /dev/null to ensure all metadata is in memory
c884a03
-        // must be recursive to handle NEFs which stores the raw image in a subIFDs
c884a03
-        std::ofstream devnull;
c884a03
-        printStructure(devnull,kpsRecursive,0);
c884a03
         ByteOrder bo = TiffParser::decode(exifData_,
c884a03
                                           iptcData_,
c884a03
                                           xmpData_,
c884a03
@@ -200,7 +196,7 @@ namespace Exiv2 {
c884a03
         Exiv2::ExifKey            key("Exif.Image.InterColorProfile");
c884a03
         Exiv2::ExifData::iterator pos   = exifData_.findKey(key);
c884a03
         if ( pos != exifData_.end()  ) {
c884a03
-            iccProfile_.alloc(pos->count());
c884a03
+            iccProfile_.alloc(pos->count()*pos->typeSize());
c884a03
             pos->copy(iccProfile_.pData_,bo);
c884a03
         }
c884a03