Updated from commit 1673a40a77a7a8c6a2d261fafaf6a24b791c727a.