Fixed bugs in sparse matrix arithmetic and CSC representation