Fix Release compilation warnings (#10904)