Merged trunk changes r509-519 into the delphi2010-port branch.
Development branch to make project compatible with Delphi 2010.