Fixed a bunch of crossplatform compile problems

I fixed some linux / crossplatform compile related problems as well as inheritance problems between some classes.