Added support for forced detach of other sessions. Trap is now set only when needed.