Fixes an issue discussed on dev ML and related with OFBIZ-6791 This before trying to backport the fixes done with commits referenced in the OFBIZ-6791 issue