fixed sparsetsmat to work more consistently with explicit NA's