Fix issue regarding base::solve not working well with objects of class Matrix