Backported warning fix from rebase