Fixed remaining term calculation.