Fixes #899: bug in scalar_matrix operations for MX

For review by Costa Rican authorities..