Fix some compilations issues on Mac.
Still doesn't run - need more work on the differentiation between Dekstop and Server