Silence various warning, fix G++ build errors.