Updated from commit 69471a19f3b389f59f7d8e9bb8c771b95c4c7b58.