Updated from commit cbc2179887aa71a0716770874c936e7ce309062b.