Improve comma insertion to cover more cases