Fixes for matrix multiplication