some fixes

* Some fixes (#45, travis build)
* Some refactoring