Fix a bug in softmax regression