Hard granules are usually formed from grainy powdered sugar. To prevent this, you should sift the sugar through a fine-mesh sieve. To fix the grains, allow the mixture to rest at room temperature overnight. This will melt the granules and when mixed, incorporate them into the rest of the frosting.