Directory : fixing bugs 3207 and 4340

https://www.silverpeas.org/redmine/issues/3207
https://www.silverpeas.org/redmine/issues/4340