Update Scalar implementation and tests after discussion in issue 338.