Removed context mark code from detach().