Fix a bug in tests