PIM-1621 : fix flexible entity references