Added `unload = TRUE` to `detach`