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