Adapt to new API
Merge pull request #1 from Merovius/apibreak

Adapt to new API