Fixed coverity found bugs at main library (src/onion).
Merge branch 'master' of github.com:davidmoreno/onion