Add a barrier and fix rank index + timing/messages