Improvement to the hypervirial theorem and Kramer's rule for the calculation of central potential matrix elements