Fix type inference errors.