Fix bug with entities mapping