Minor changes for stability of cross-entropy