Fix a bug in vectorization.