Update to keep track of sizes statically and work with new LinAlg interface