Improve  unit tests