Fixed buggy matrix class.