Fixed clearing of the 'update tos detached' flag.