Stacked graph bugfixes from matrix refactor