fixed some bugs
Merge pull request #33 from dvicini/master

fixed some bugs