Fixed a bug in tests