Renamed TestDistToStackCalculator.
Fixed clearing of 'updated tos detached' flag.