Updated from commit cb2c78a3de145a526bca5adf8dfdfcbefac0bfce.