Improving logging for chat calls, and fixing npe in rank