Added check to dividing a matrix by a scalar