Updated from commit b81be87134ae67a1510802e024caadc4719932f3.