Added (dimension) sanity checks to raw write/send routine.