Updated from commit eaf4c8ce6bbb7df451a2955b24bb63c164bd2eeb.