Fix errors in tests