fix some gcc bugs