Added attach/detach tests