Fix errors in unit tests