Fix portable issues