Fixed bug in unit test