Fix issue with None in parameter validation

If the value for an argument is None and the argument definition allows None
as value then the attribute must be stored without the type cast to preserve
the None value.

Fixes #4727