Fix discount expiration check. Closes #1773