Fix type checking