fix some unexpected compilation errors (in Delphi 2007)