gcc compilation errors fixed