Fixed deprecated warnings in tests