Fix warnings about deprecated methods