Fix deprecation warnings in unit tests