Fix for crash trying to set value on 'boxed type' on old .NET versions