Fixed code so that it compiles with FPC 2.7.1