Fix type assertion