Fix errors in the unit tests