Added calculation of empty rule elements