Fixes #6758 : Resolve 3.1 build issues.