Update unit test and code