Fix ALV-677 (most probably, backporting fix for ALF-18436, that is not mentioned in Alfresco JIRA for some reason)