Bug fix in tests