diff --git a/src/plugins/server/kernel_ast.ml b/src/plugins/server/kernel_ast.ml
index 43d62970c191c9b447c22df2ddcef667c16db700..d737bb1bfab032bef1724d261ace4eabbc3e927e 100644
--- a/src/plugins/server/kernel_ast.ml
+++ b/src/plugins/server/kernel_ast.ml
@@ -321,8 +321,7 @@ struct
     | None -> false
 
   let is_fundecl = function
-    | PGlobal (GFun _ | GFunDecl _) -> true
-    | PGlobal (GVar (vi, _, _) | GVarDecl (vi, _)) -> Globals.Functions.mem vi
+    | PVDecl(Some _,Kglobal,vi) -> vi.vglob && Globals.Functions.mem vi
     | _ -> false
 
   let scope tag =