Fixed valuecount behaviour for None parameter.
Changed error type.