Fixed bug in matrices.py