Fix a bug introduced by recent optimization efforts.