Fixing bugs #5766, #5801, #5840 and #5842

See tracker.silverpeas.org for further details...