Fixed compilation issues on darwin and windows targets.