fixed compilation issues on newer versions of Delphi