add support for fractional total - several small bug fixes