Fix Opacity value crash and cast when value is null