Fix deprecation warnings, minor fixes