Fixed a bug on Matrix