small fixes to circumvent an asm generation issue with Delphi 2007