Fix "detach" command

Fixes #15