Moved validate subtotal limits into compute costs. Fixed #3.