PTR-01-03: Fixed several compile error

Now compiles and ready to be tested, although many server errors are
possible.