fixes and make it compile
Merge pull request #158 from cortiz/master

fixes and make it compile