Fix bug
Fix bug linked to side effect of the database modification
Reduce left join to gain more performance