Fix type errors on <17.0