Updated from commit be6c70e74fd6caaab278c870b4f4c660557df605.