Unit testing and matrix algebra improvements.