Fix bug in matrix multiplication