misc set of bug fixes.
Merge branch 'master' of https://github.com/maxime01/btc