Fixed some bugs
Merge pull request #3 from cristomc/master

Fixed some bugs