Fixed memory leaks and copy paste error in ElementTabSet
Fix pointer conversion bug in Variant