Fixed initialization of matrices