diff --git a/apps/metadata/mod.c b/apps/metadata/mod.c
index dbedc6e..d7c5d87 100644
--- a/apps/metadata/mod.c
+++ b/apps/metadata/mod.c
@@ -19,47 +19,53 @@
  *
  ****************************************************************************/
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <inttypes.h>
 
 #include "system.h"
+#include "string-extra.h"
 #include "metadata.h"
 #include "metadata_common.h"
 #include "metadata_parsers.h"
 #include "rbunicode.h"
 
+#define MAGIC_OFFSET (0x438)
 bool get_mod_metadata(int fd, struct mp3entry* id3)
-{    
+{
     /* Use the trackname part of the id3 structure as a temporary buffer */
-    unsigned char buf[1084];
+    unsigned char buf[0x43C];
     int read_bytes;
     char *p;
       
 
     if ((lseek(fd, 0, SEEK_SET) < 0) 
-         || ((read_bytes = read(fd, buf, sizeof(buf))) < 1084))
+         || ((read_bytes = read(fd, buf, sizeof(buf))) < (ssize_t)sizeof(buf)))
+    {
+        return false;
+    }
+
+    /* is it a .mod file ?
+     * if we don't find the magic, we need some \0 bytes or
+     * the code below will fail */
+    if (memcmp(&buf[MAGIC_OFFSET], "M.K.", 4) &&
+        memcmp(&buf[MAGIC_OFFSET], "M!K!", 4) &&
+        memchr(buf, '\0', sizeof(buf)) == NULL)
     {
         return false;
     }
-    
-    /* We don't do file format checking here
-     * There can be .mod files without any signatures out there */
 
     p = id3->id3v2buf;
-    
+
     /* Copy Title */
-    strcpy(p, &buf[0x00]);
+    strlcpy(p, &buf[0x00], sizeof(id3->id3v2buf));
     id3->title = p;
-    p += strlen(p)+1;
 
     id3->bitrate = filesize(fd)/1024; /* size in kb */
     id3->frequency = 44100;
     id3->length = 120*1000;
     id3->vbr = false;
     id3->filesize = filesize(fd);
-        
     return true;
 }
 
