Fixed a bug in the unit test