Detaching something detached no longer throws an exception. #154

Detaching something detached will just return the detached thing.  Made code a bit cleaner in places.