Porting more existing code to new Matrix class.
Further porting.