Fix compile errors with Lazarus on Windows