Fixed a broken contract. Used more efficient loops for matrix operations.
Added the matrix multiplication overload which went missing.