Fix bug in tests