Merged trunk changes r538-546 into the delphi2010-port branch.
Merged trunk changes r401:429 into the delphi2010-port branch.
Development branch to make project compatible with Delphi 2010.