Fixed messenger reading/writing functions