Avoid deprecation warnings in test cases.