bug fixes due to new API
Merge pull request #270 from clovis/master

bug fixes