Fixing some deprecation warnings