Fix basis calculation for FIFO or LIFO when less than one lot is sold.