Matrix error in mul function