Fix matrix vector multiplication when dimension is zero