If these slices get converted to column vectors, it should work to set columns directly here instead of transposing below. I'm not sure about performance tradeoffs vs what you have here- it's probably okay to keep as-is.