Imroved unit tests