Fixed some deprecation warnings in the tests.