Upstream pull

To fix deprecation warnings.