Bug fixed
Fixed bugs related to init function
Merge pull request #2 from bernatfp/master

Adapted for v0.3 compatibility