See branch bug-272e866f1e for a possible fix.