Fixed a bunch of bugs.
Merge branch 'develop' of github.com:js-platform/p2p into develop