diff --git a/src/main/scala/inox/ast/CallGraph.scala b/src/main/scala/inox/ast/CallGraph.scala
index 5146be4a95f0489b7bddbf73ef764677f71aa103..7cd906ba60b4f348c51f97a4744916ca665d110a 100644
--- a/src/main/scala/inox/ast/CallGraph.scala
+++ b/src/main/scala/inox/ast/CallGraph.scala
@@ -13,7 +13,7 @@ trait CallGraph {
 
   private def collectCallsInPats(fd: FunDef)(p: Pattern): Set[(FunDef, FunDef)] =
     (p match {
-      case u: UnapplyPattern => Set((fd, symbols.getFunction(u.id)))
+      case u: UnapplyPattern => Set((fd, symbols.getFunction(u.fd)))
       case _ => Set()
     }) ++ p.subPatterns.flatMap(collectCallsInPats(fd))
 
diff --git a/src/main/scala/inox/ast/Expressions.scala b/src/main/scala/inox/ast/Expressions.scala
index 20fccb748e466c20be6bdcf9e8c4e3c267d51dae..2700994fb7fe01b207a65301584b87d438786e1d 100644
--- a/src/main/scala/inox/ast/Expressions.scala
+++ b/src/main/scala/inox/ast/Expressions.scala
@@ -272,9 +272,9 @@ trait Expressions { self: Trees =>
   }
 
   /** A custom pattern defined through an object's `unapply` function */
-  case class UnapplyPattern(binder: Option[ValDef], id: Identifier, tps: Seq[Type], subPatterns: Seq[Pattern]) extends Pattern {
+  case class UnapplyPattern(binder: Option[ValDef], fd: Identifier, tps: Seq[Type], subPatterns: Seq[Pattern]) extends Pattern {
     // Hacky, but ok
-    def optionType(implicit s: Symbols) = s.getFunction(id, tps).returnType.asInstanceOf[ClassType]
+    def optionType(implicit s: Symbols) = s.getFunction(fd, tps).returnType.asInstanceOf[ClassType]
     def optionChildren(implicit s: Symbols): (ClassType, ClassType) = {
       val children = optionType.tcd.asInstanceOf[TypedAbstractClassDef].descendants.sortBy(_.fields.size)
       val Seq(noneType, someType) = children.map(_.toType)
@@ -297,7 +297,7 @@ trait Expressions { self: Trees =>
       val vd = ValDef(FreshIdentifier("unap", true), optionType)
       Let(
         vd,
-        FunctionInvocation(id, tps, Seq(scrut)),
+        FunctionInvocation(fd, tps, Seq(scrut)),
         IfExpr(
           IsInstanceOf(vd.toVariable, someType),
           someCase(CaseClassSelector(someType, vd.toVariable, someValue.id)),
@@ -318,12 +318,12 @@ trait Expressions { self: Trees =>
       */
     def getUnsafe(scrut: Expr)(implicit s: Symbols) = CaseClassSelector(
       someType,
-      FunctionInvocation(id, tps, Seq(scrut)),
+      FunctionInvocation(fd, tps, Seq(scrut)),
       someValue.id
     )
 
     def isSome(scrut: Expr)(implicit s: Symbols) =
-      IsInstanceOf(FunctionInvocation(id, tps, Seq(scrut)), someType)
+      IsInstanceOf(FunctionInvocation(fd, tps, Seq(scrut)), someType)
   }
 
   // Extracts without taking care of the binder. (contrary to Extractos.Pattern)