Solve deprecation warnings