Fixed a bug in TargetPermanent where remaining targets can get negative. That solves issue #92.
Some changes to the handling of the return value.