Fixed warnings in tests due to deprecations