Improvements in the computation of grain opacity