Make compilable in Lazarus/FPC

Compiles but still incomplete