fixed Delphi 5 compilation errors