Fixed compilation errors on some platforms