Fixed bug in matrix allocation