Fix type specs for OTP releases prior to 17.0