I've included his fix from #1478.