Fixes #6614 : Adding fix for 3.1