Use the correct probability for doc confidence.
Fix a crash when viewing messages in the heatmap.