Refactored some code and fixed #37
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop