Problem reported by Marien Zwart in: GNOME/glib#878 Derived from a fix by John Ralls proposed in that bug report.