Fixed gcc compilation errors