Fixes deprecation warnings when runing tests.