Pencil kernel correction and residual error estimation for quality-index-based dose calculations