Type annotation fixes for OTP 17.0