Fixes #6615 : Re-adding previous changes.