Fix type check