Solve the warnings introduced in previous code

re #6175