more matrix cleanups