Correct error in resolving deprecated warnings