bug fixes
Merge pull request #161 from clovis/master

bug fixes and optimizations