Improve unit tests