Fixed a bug in unit test