Fixing assertion error in tests