diff --git a/src/decode_r2007.c b/src/decode_r2007.c
index b89e585..e1c5af9 100644
--- a/src/decode_r2007.c
+++ b/src/decode_r2007.c
@@ -693,14 +693,14 @@ read_sections_map(Bit_Chain* dat, int64_t size_comp,
       bfr_read(section, &ptr, 64);
     
       LOG_TRACE("\n--- Section ---\n")
-      LOG_TRACE("data size:     %lld\n", section->data_size)
-      LOG_TRACE("max size:      %lld\n", section->max_size)
-      LOG_TRACE("encryption:    %lld\n", section->encrypted)
-      LOG_TRACE("hashcode:      %llx\n", section->hashcode)
-      LOG_TRACE("name length:   %lld\n", section->name_length)
-      LOG_TRACE("unknown:       %lld\n", section->unknown)
-      LOG_TRACE("encoding:      %lld\n", section->encoded)
-      LOG_TRACE("num pages:     %lld\n", section->num_pages)      
+      LOG_TRACE("data size:     %jd\n", section->data_size)
+      LOG_TRACE("max size:      %jd\n", section->max_size)
+      LOG_TRACE("encryption:    %jd\n", section->encrypted)
+      LOG_TRACE("hashcode:      %jd\n", section->hashcode)
+      LOG_TRACE("name length:   %jd\n", section->name_length)
+      LOG_TRACE("unknown:       %jd\n", section->unknown)
+      LOG_TRACE("encoding:      %jd\n", section->encoded)
+      LOG_TRACE("num pages:     %jd\n", section->num_pages)      
     
       section->next  = 0;
       section->pages = 0;
@@ -732,13 +732,13 @@ read_sections_map(Bit_Chain* dat, int64_t size_comp,
           bfr_read(section->pages[i], &ptr, 56);
       
           LOG_TRACE("\n   --- Page ---\n")
-          LOG_TRACE("   offset:        %lld\n", section->pages[i]->offset);
-          LOG_TRACE("   size:          %lld\n", section->pages[i]->size);
-          LOG_TRACE("   id:            %lld\n", section->pages[i]->id);
-          LOG_TRACE("   uncomp_size:   %lld\n", section->pages[i]->uncomp_size);
-          LOG_TRACE("   comp_size:     %lld\n", section->pages[i]->comp_size);
-          LOG_TRACE("   checksum:      %llx\n", section->pages[i]->checksum);
-          LOG_TRACE("   crc:           %llx\n\n", section->pages[i]->crc);
+          LOG_TRACE("   offset:        %jd\n", section->pages[i]->offset);
+          LOG_TRACE("   size:          %jd\n", section->pages[i]->size);
+          LOG_TRACE("   id:            %jd\n", section->pages[i]->id);
+          LOG_TRACE("   uncomp_size:   %jd\n", section->pages[i]->uncomp_size);
+          LOG_TRACE("   comp_size:     %jd\n", section->pages[i]->comp_size);
+          LOG_TRACE("   checksum:      %jd\n", section->pages[i]->checksum);
+          LOG_TRACE("   crc:           %jd\n\n", section->pages[i]->crc);
         }
     }
   
@@ -785,9 +785,9 @@ read_pages_map(Bit_Chain* dat, int64_t size_comp,
       index = page->id > 0 ? page->id : -page->id;
     
       LOG_TRACE("\n--- Page ---\n")
-      LOG_TRACE("size:    0x%llx\n", page->size)
-      LOG_TRACE("id:      0x%llx\n", page->id)
-      LOG_TRACE("offset:  0x%llx\n\n", page->offset)
+      LOG_TRACE("size:    0x%jd\n", page->size)
+      LOG_TRACE("id:      0x%jd\n", page->id)
+      LOG_TRACE("offset:  0x%jd\n\n", page->offset)
     
       page->next = 0;      
     
diff --git a/src/dwg.c b/src/dwg.c
index 9c4b9a1..2586c55 100644
--- a/src/dwg.c
+++ b/src/dwg.c
@@ -194,7 +194,7 @@ dwg_bmp(Dwg_Data *stk, long int *size)
       else if (code == 3)
         {
           bit_read_RL(dat);
-          LOG_TRACE("\t\tWMF size: 0x%x\n", bit_read_RL (dat))
+          LOG_TRACE("\t\tWMF size: 0x%lu\n", bit_read_RL (dat))
         }
       else
         {
diff --git a/src/encode.c b/src/encode.c
index 0c6a0d5..41731ce 100644
--- a/src/encode.c
+++ b/src/encode.c
@@ -518,7 +518,7 @@ dwg_encode_chains(Dwg_Data * dwg, Bit_Chain * dat)
       bit_write_CRC(dat, omap[i].address, 0xC0C1);
     }
     for (i = 0; i < dwg->num_objects; i++) 
-      LOG_INFO ("Object(%i): %6lu / Address: %08X / Idc: %u\n", 
+      LOG_INFO ("Object(%lu): %6lu / Address: %08ld / Idc: %u\n", 
 		 i, omap[i].handle, omap[i].address, omap[i].idc);
 
   /* Unknown bitdouble between objects and object map
@@ -735,7 +735,7 @@ dwg_encode_add_object(Dwg_Object * obj, Bit_Chain * dat,
   dat->byte = address;
   dat->bit = 0;
 
-      LOG_INFO("\n\n======================\nObject number: %lu",
+      LOG_INFO("\n\n======================\nObject number: %x",
           obj->index)
 
   bit_write_MS(dat, obj->size);
