TMS Scripter type casting issues in x64

We found issues with following procedure when running in x64. Basically using integer to represent an object but in x64 need to use ObjectToVar. We think there may be other code where type casting to INTEGER may give issues.

Note we used an IFDEF to put our corrected code.

procedure TatMenusLibrary.__GetTPopupMenuPopupPoint(AMachine: TatVirtualMachine);
begin
with AMachine do
begin
{$IFDEF TOWERSWATSON}
ReturnOutputArg(ObjectToVar(TPointWrapper.Create(TPopupMenu(CurrentObject).PopupPoint)));
{$ELSE}
ReturnOutputArg(integer(TPointWrapper.Create(TPopupMenu(CurrentObject).PopupPoint)));
{$ENDIF}
end;
end;