Okay, two big problems people pointed out about the end of the series were how overpowered the scorpion ballistas were and their inconsistency (fist they shot down one of the dragons with ease but then they couldn't hit Danaerys and Drogon even when they were making a B-line right for the iron fleet).
But I think if they had cannons it could solve both of these issues. They could show Cersei talking to a trader who brought her an explosive powder all the way from the Eastern end of Essos (the GoT version of China) and they would then use it to shoot down Rhaegal and destroy Danaery's fleet. A ballista couldn't tear through a ship like that but cannon balls could so that would solve the problem of them being overpowered. But as for the inconsistency, you could have it rain shortly before the battle of Kings' Landing which would make the gunpowder wet and prevent it from working which closes the plot hole. Now you might ask how could Danaerys burn the city but it seems the dragons' breath works by spraying combustible liquid which will still burn even if it lands on a damp surface so that's not a problem (although I don't know how the dragons could use fire to destroy stone buildings).
I know some people would say that if it's in a Medieval-esque setting you shouldn't have firearms but in my opinion they're alright as long as they're at the end of the series.
That's some serious plot armor.