Corrected bug in matrix mul function