diff --git a/app/lib/dal/sqliteDAL/MetaDAL.ts b/app/lib/dal/sqliteDAL/MetaDAL.ts
index 158d39f4ddf10a1890ac3af8a93483272bce39aa..4cb8299eb7ee31c9ef0bdce4c9a348d88b444d2d 100644
--- a/app/lib/dal/sqliteDAL/MetaDAL.ts
+++ b/app/lib/dal/sqliteDAL/MetaDAL.ts
@@ -407,14 +407,14 @@ export class MetaDAL extends AbstractSQLite<DBMeta> {
       'COMMIT;')
   }
 
-  private async executeMigration(migration: any[], conf:ConfDTO) {
+  private async executeMigration(migration: (string|((conf:ConfDTO)=>void)), conf:ConfDTO) {
     try {
       if (typeof migration == "string") {
 
         // Simple SQL script to pass
         await this.exec(migration);
 
-      } else if (typeof migration == "function") {
+      } else {
 
         // JS function to execute
         await migration(conf);
diff --git a/app/modules/crawler/lib/sync.ts b/app/modules/crawler/lib/sync.ts
index e5f39d8a7a77ae0209540c5d0a8e36baddcce7f9..df6f29031bb618f2a6083f886c453b3e9553bc5a 100644
--- a/app/modules/crawler/lib/sync.ts
+++ b/app/modules/crawler/lib/sync.ts
@@ -759,7 +759,7 @@ class P2PDownloader {
       // Continue
       return chosens;
     }, []);
-    let candidates = await Promise.all(promises)
+    let candidates:any[] = await Promise.all(promises)
     candidates.forEach((c:any) => {
       c.tta = c.tta || 0; // By default we say a node is super slow to answer
       c.ttas = c.ttas || []; // Memorize the answer delays