Fix some deprecation warnings in tests