Fix type checking error