Cast to sparse matrix had been commented out