Fix data conversion error. Save intermediate outputs. Hopefully speed up data conversion part by only doing a single matrix conversion (soubles memory consumption, but so what)