Fix deprecation error and warning in test suite.