Improved unit tests