fix deprecation warnings and whitespace