Fixing gcc compilation problems