For message transmission, execute the supplied callback to the caller regardless of if there was an error. Also fix header generation.