Revert back sparse handling--too much array copying. Various other fixes.