Backport 13b9bd45e44b8dfd9e257add65eb40374622970c