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

fixes and make it compile