Fixes deprecation warnings.