Fixed some bugs in mul code.