Fixed bugs in Matrix.py