trying to debug memory errors
fix mem leak in sparse solver test
fixing indexes