Part of issue #768