Fixed errors in local Variant casting.