Fix type for loop