diff --git a/src/EntityTrait.php b/src/EntityTrait.php
index 26a8723..ae86450 100644
--- a/src/EntityTrait.php
+++ b/src/EntityTrait.php
@@ -306,9 +306,12 @@ trait EntityTrait {
     }
 
     #[Ignore]
-    public static function field($name, null|string|bool $alias = Repository::DEFAULT_ALIAS) : EntityField
+    public static function field($name, null|string|false $alias = Repository::DEFAULT_ALIAS) : EntityField
     {
-        return new EntityField(static::class, $name, $alias ? Ulmus::repository(static::class)->adapter->adapter()->escapeIdentifier($alias, Adapter\AdapterInterface::IDENTIFIER_FIELD) : ( $alias === false ? '' : Repository::DEFAULT_ALIAS ), Ulmus::resolveEntity(static::class));
+
+        $default = ( $alias === false ? '' : Repository::DEFAULT_ALIAS ); # bw compatibility, to be deprecated
+
+        return new EntityField(static::class, $name, $alias ? Ulmus::repository(static::class)->adapter->adapter()->escapeIdentifier($alias, Adapter\AdapterInterface::IDENTIFIER_FIELD) : $default, Ulmus::resolveEntity(static::class));
     }
 
     #[Ignore]
diff --git a/src/Repository.php b/src/Repository.php
index 9fc7f2b..1dcb8b4 100644
--- a/src/Repository.php
+++ b/src/Repository.php
@@ -114,7 +114,7 @@ class Repository
             throw new Exception\EntityPrimaryKeyUnknown("A primary key value has to be defined to delete an item.");
         }
 
-        return (bool) $this->wherePrimaryKey($value)->deleteOne()->rowCount;
+        return (bool) $this->wherePrimaryKey($value, null)->deleteOne()->rowCount;
     }
 
     public function destroy(object $entity) : bool
@@ -599,7 +599,7 @@ class Repository
         return $this;
     }
 
-    public function wherePrimaryKey(mixed $value) : self
+    public function wherePrimaryKey(mixed $value, null|string|bool $alias = self::DEFAULT_ALIAS) : self
     {
         if ( null === $primaryKeyField = Ulmus::resolveEntity($this->entityClass)->getPrimaryKeyField() ) {
             throw new Exception\EntityPrimaryKeyUnknown("Entity has no field containing attributes 'primary_key'");
@@ -607,7 +607,7 @@ class Repository
 
         $pkField = key($primaryKeyField);
 
-        return $this->where($this->entityClass::field($primaryKeyField[$pkField]->name ?? $pkField), $value);
+        return $this->where($this->entityClass::field($primaryKeyField[$pkField]->name ?? $pkField, false), $value);
     }
 
     public function withJoin(string|array $fields, array $options = []) : self