Tweaks to make taxes after discounts option work correctly. #1744