Fixes deprecation warnings