Use correct index.
Reject deferred on close.
Unregister transport on fail.
Merge pull request #40 from ComradeDOS/master

Bugfixing