XWIKI-7718 & XWIKI-8972 fixed.