Bugfix on Entity.php